#pragma once
#include "svm.h"

class UsingSVM {
private:
	int max_line_len;
	svm_node *_svmNodePool;
	svm_problem _svmProb;
	svm_parameter _svmParam;
	svm_model *_svmModel;
public:
	int _svmM, _svmN;

private:
	char* readline(FILE *input, char line[] = NULL);

public:
	UsingSVM(void) {init();}
	~UsingSVM(void) {clear();}
	svm_problem& read_problem(const char filename[]);
	svm_parameter& initParam(void);
	svm_model*& train(void);
	void predict(char modelFile[], char inputfile[], char outputfile[], bool pp = false);
	void clear(void);
	void init(void);
};
